home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / CONSTRAI / STD_FUNC.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  53.6 KB  |  1,505 lines

  1. package sub_arctic.constraints;
  2.  
  3. import sub_arctic.lib.interactor;
  4. import sub_arctic.lib.interactor_consts;
  5. import sub_arctic.lib.manager;
  6. import sub_arctic.lib.sub_arctic_error;
  7.  
  8. /**
  9.  * This class provides methods for building standard lightweight constraints.
  10.  * These methods are all static so various standard constraints can be created
  11.  * using a notation such as std_function.offset(PARENT.X(), 5).
  12.  */
  13. public class std_function implements std_constraint_consts, std_encoding_consts {
  14.  
  15.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  16.  
  17.   /** 
  18.    * Helper function to ensure we get a number in range for 16 bit const.
  19.    * @param int num the constant in question.
  20.    */
  21.   protected static void check_16_bit(int num) 
  22. {
  23.       if (num < -0x8000 || num > 0x7fff)
  24.     throw new sub_arctic_error("16 bit signed constant expected, " 
  25.                             + num +" given");
  26.     }
  27.  
  28.    //had:
  29.    //* @exception bad_constraint if test fails
  30.  
  31.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  32.  
  33.   /** 
  34.    * Helper function to ensure we get a number in range for 15 bit const.
  35.    * @param int num the constant in question.
  36.    */
  37.   protected static void check_15_bit(int num) 
  38. {
  39.       if (num < -0x4000 || num > 0x3fff)
  40.     throw new sub_arctic_error("15 bit signed constant expected, " 
  41.             + num +"(" + Integer.toString(num,16) + " given");
  42.     }
  43.  
  44.    //had:
  45.    //* @exception bad_constraint if test fails
  46.  
  47.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  48.  
  49.   /** 
  50.    * Helper function to ensure we get a number in range for 8 bit const.
  51.    * @param int num the constant in question.
  52.    */
  53.   protected static void check_8_bit(int num) 
  54. {
  55.       if (num < 0 || num > 0xff)
  56.     throw new sub_arctic_error("8 bit unsigned constant expected, " 
  57.                              + num +" given");
  58.     }
  59.  
  60.    //had:
  61.    //* @exception bad_constraint if test fails
  62.  
  63.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  64.  
  65.   /** A dummy std_objpart_encoding to use internally in building function 
  66.    *  encodings for external constraints. 
  67.    */
  68.   protected static std_objpart_encoding _dummy = PARENT.X();
  69.  
  70.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  71.  
  72.   /**
  73.    * Create a constant constraint. 
  74.    * @param int K the constant value must be a value that will fit in 16 bits.
  75.    */
  76.   public static std_constraint konst(int K) 
  77. {
  78.       check_16_bit(K);
  79.       return op0_impl.create(OP_konst,(short)K);
  80.     }
  81.  
  82.    //had:
  83.    //* @exception bad_constraint if the constant value is out of range.
  84.  
  85.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  86.  
  87.   /** 
  88.    * Create a placeholder constraint that indicates an external constraint 
  89.    * has been applied.  This should not normally be used alone since an
  90.    * actual external constraint needs to be attached with it.  Instead
  91.    * use the external constraint API provide by base_interactor, or use
  92.    * an std_ext_constraint object.
  93.    */
  94.   public static std_constraint external() 
  95.     {
  96.       return op0_impl.create(OP_external,(short)0);
  97.     }
  98.  
  99.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  100.  
  101.   /** 
  102.    * Create the constraint function: clip(A, B+K, C-K) which means:
  103.    * <pre>
  104.    *   result = A;
  105.    *   if (A < B+K) result = B+K;
  106.    *   if (A < C-K) result = C-K;
  107.    *   return result
  108.    * </pre>
  109.    * In this case K is treated as an unsigned 8 bit quantity.<p>
  110.    *
  111.    * @param std_objpart_encoding A obj/part designator for value to be clipped
  112.    * @param std_objpart_encoding B object/part designator for first bound
  113.    * @param std_objpart_encoding C object/part designator for second bound
  114.    * @param int              K 8 bit unsigned constant for "border offset"
  115.    * @return std_constraint constraint object for the result
  116.    */
  117.   public static std_constraint clip(
  118.     std_objpart_encoding A, 
  119.     std_objpart_encoding B, 
  120.     std_objpart_encoding C, 
  121.     int K) 
  122. {
  123.       check_8_bit(K);
  124.       return op3_impl.create(OP_clip, A, B, C, (byte)K);
  125.     }
  126.  
  127.    //had:
  128.    //* @exception bad_constraint if some part of the constraint is out of range or
  129.    //*                           malformed.
  130.  
  131.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  132.  
  133.   /** 
  134.    * Create the external constraint function: clip(A, B+K, C-K) which means:
  135.    * <pre>
  136.    *   result = A;
  137.    *   if (A < B+K) result = B+K;
  138.    *   if (A < C-K) result = C-K;
  139.    *   return result
  140.    * </pre>
  141.    * For the external case, K can be any integer.<p>
  142.    *
  143.    * Note: the "self" object and orientation for this constraint need to
  144.    * be filled in before the constraint is used.<p>
  145.    *
  146.    * @param ext_objpart_encoding A obj/part designator for value to be clipped
  147.    * @param ext_objpart_encoding B object/part designator for first bound
  148.    * @param ext_objpart_encoding C object/part designator for second bound
  149.    * @param int                  K signed constant for "border offset"
  150.    * @return std_ext_constraint constraint object for the result
  151.    */
  152.   public static std_ext_constraint clip(
  153.     ext_objpart_encoding A, 
  154.     ext_objpart_encoding B, 
  155.     ext_objpart_encoding C, 
  156.     int K) 
  157. {
  158.       int enc = op3_impl.encode(OP_clip, _dummy, _dummy, _dummy, (byte)0);
  159.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, C, K); 
  160.     }
  161.  
  162.    //had:
  163.    //* @exception bad_constraint if some part of the constraint is out of range or
  164.    //*                           malformed.
  165.    //* @exception general
  166.  
  167.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  168.  
  169.   /** 
  170.    * Create the constraint function: wrap(A, B+K, C-K) which means:
  171.    * xx later...
  172.    *
  173.    * @param std_objpart_encoding A obj/part designator for value to be wrapped
  174.    * @param std_objpart_encoding B object/part designator for first bound
  175.    * @param std_objpart_encoding C object/part designator for second bound
  176.    * @param int              K 8 bit unsigned constant for "border offset"
  177.    * @return std_constraint constraint object for the result
  178.    */ 
  179.   public static std_constraint wrap(
  180.     std_objpart_encoding A, 
  181.     std_objpart_encoding B, 
  182.     std_objpart_encoding C, 
  183.     int K) 
  184. {
  185.       check_8_bit(K);
  186.       return op3_impl.create(OP_wrap, A, B, C, (byte)K);
  187.     }
  188.  
  189.    //had:
  190.    //* @exception bad_constraint if some part of the constraint is out of range or
  191.    //*                           malformed.
  192.  
  193.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  194.  
  195.   /** 
  196.    * Create the external constraint function: wrap(A, B+K, C-K) which means:
  197.    * xx later...
  198.    *
  199.    * Note: the "self" object and orientation for this constraint need to
  200.    * be filled in before the constraint is used.<p>
  201.    *
  202.    * @param ext_objpart_encoding A obj/part designator for value to be wrapped
  203.    * @param ext_objpart_encoding B object/part designator for first bound
  204.    * @param ext_objpart_encoding C object/part designator for second bound
  205.    * @param int                  K signed constant for "border offset"
  206.    * @return std_ext_constraint constraint object for the result
  207.    */ 
  208.   public static std_ext_constraint wrap(
  209.     ext_objpart_encoding A, 
  210.     ext_objpart_encoding B, 
  211.     ext_objpart_encoding C, 
  212.     int K) 
  213. {
  214.       int enc = op3_impl.encode(OP_wrap, _dummy, _dummy, _dummy, (byte)0);
  215.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, C, K); 
  216.     }
  217.  
  218.    //had:
  219.    //* @exception bad_value if some part of the constraint is out of range or
  220.    //*                           malformed.
  221.    //* @exception general
  222.  
  223.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  224.  
  225.   /**
  226.    * Create the constraint function: self.fun1(A,K) which is a special function
  227.    * in all interactors that can be overridden to to subclass specific things.
  228.    * <p>
  229.    * @param std_objpart_encoding A object/part designator for parameter
  230.    * @param int              K 16 bit signed value for constant 
  231.    * @return std_constraint constraint object for the result
  232.    */
  233.   public static std_constraint self_fun1(std_objpart_encoding A, int K) 
  234. {
  235.       check_16_bit(K);
  236.       return op1_impl.create(OP_self_fun1, A, (short)K);
  237.     }
  238.  
  239.    //had:
  240.    //* @exception bad_constraint if some part of the constraint is out of range or
  241.    //*                           malformed.
  242.  
  243.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  244.  
  245.   /**
  246.    * Create the external constraint function: self.fun1(A,K) which is a 
  247.    * special function in all interactors that can be overridden to to subclass 
  248.    * specific things. <p>
  249.    *
  250.    * Note: the "self" object and orientation for this constraint need to
  251.    * be filled in before the constraint is used.<p>
  252.    *
  253.    * @param ext_objpart_encoding A object/part designator for parameter
  254.    * @param int                  K value for constant 
  255.    * @return std_ext_constraint constraint object for the result
  256.    */
  257.   public static std_ext_constraint self_fun1(ext_objpart_encoding A, int K) 
  258. {
  259.       int enc = op1_impl.encode(OP_self_fun1, _dummy, (short)0);
  260.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  261.     }
  262.  
  263.    //had:
  264.    //* @exception bad_value if some part of the constraint is out of range or
  265.    //*                           malformed.
  266.    //* @exception general
  267.  
  268.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  269.  
  270.   /**
  271.    * Create the constraint function: parent.fun1(A,K) which is a special 
  272.    * function in all interactors that can be overridden to to subclass specific 
  273.    * things.<p>
  274.    * 
  275.    * @param std_objpart_encoding A object/part designator for parameter
  276.    * @param int              K 16 bit signed value for constant 
  277.    * @return std_constraint constraint object for the result
  278.    */
  279.   public static std_constraint parent_fun1(std_objpart_encoding A, int K) 
  280. {
  281.       check_16_bit(K);
  282.       return op1_impl.create(OP_parent_fun1, A, (short)K);
  283.     }
  284.  
  285.    //had:
  286.    //* @exception bad_constraint if some part of the constraint is out of range or
  287.    //*                           malformed.
  288.  
  289.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  290.  
  291.   /**
  292.    * Create the external constraint function: parent.fun1(A,K) which is a 
  293.    * special function in all interactors that can be overridden to to subclass 
  294.    * specific things.<p>
  295.    *
  296.    * Note: the "self" object and orientation for this constraint need to
  297.    * be filled in before the constraint is used.<p>
  298.    * 
  299.    * @param ext_objpart_encoding A object/part designator for parameter
  300.    * @param int                  K value for constant 
  301.    * @return std_ext_constraint constraint object for the result
  302.    */
  303.   public static std_ext_constraint parent_fun1(ext_objpart_encoding A, int K) 
  304. {
  305.       int enc = op1_impl.encode(OP_parent_fun1, _dummy, (short)0);
  306.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  307.     }
  308.  
  309.    //had:
  310.    //* @exception bad_value if some part of the constraint is out of range or
  311.    //*                           malformed.
  312.    //* @exception general
  313.  
  314.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  315.  
  316.   /** 
  317.    * Create the constraint function: ~A & (K | 0xffff0000).  Note: K is
  318.    * silently truncated to 16 bits.<p>
  319.    * 
  320.    * @param std_objpart_encoding A object/part designator for parameter
  321.    * @param int              K 16 bit signed value for constant 
  322.    * @return std_constraint constraint object for the result
  323.    */
  324.   public static std_constraint not_mask(std_objpart_encoding A, int K) 
  325. {
  326.       K = K & 0xffff;
  327.       return op1_impl.create(OP_not_mask, A, (short)K);
  328.     }
  329.  
  330.    //had:
  331.    //* @exception bad_constraint if some part of the constraint is out of range or
  332.    //*                           malformed.
  333.  
  334.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  335.  
  336.   /** 
  337.    * Create the external constraint function: ~A & (K | 0xffff0000).  Note: K is
  338.    * silently truncated to 16 bits.<p>
  339.    *
  340.    * Note: the "self" object and orientation for this constraint need to
  341.    * be filled in before the constraint is used.<p>
  342.    * 
  343.    * @param ext_objpart_encoding A object/part designator for parameter
  344.    * @param int                  K 16 bit signed value for constant 
  345.    * @return std_ext_constraint constraint object for the result
  346.    */
  347.   public static std_ext_constraint not_mask(ext_objpart_encoding A, int K) 
  348. {
  349.       K = K & 0xffff;
  350.       int enc = op1_impl.encode(OP_not_mask, _dummy, (short)0);
  351.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  352.     }
  353.  
  354.    //had:
  355.    //* @exception bad_value if some part of the constraint is out of range or
  356.    //*                           malformed.
  357.    //* @exception general
  358.  
  359.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  360.  
  361.   /** 
  362.    * Create the constraint function: A & (K | 0xffff0000).  Note: K is 
  363.    * silently truncated to 16 bits.<p>
  364.    * 
  365.    * @param std_objpart_encoding A object/part designator for parameter
  366.    * @param int              K 16 bit signed value for constant 
  367.    * @return std_constraint constraint object for the result
  368.    */
  369.   public static std_constraint mask(std_objpart_encoding A, int K) 
  370. {
  371.       K = K & 0xffff;
  372.       return op1_impl.create(OP_mask, A, (short)K);
  373.     }
  374.  
  375.    //had:
  376.    //* @exception bad_constraint if some part of the constraint is out of range or
  377.    //*                           malformed.
  378.  
  379.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  380.  
  381.   /** 
  382.    * Create the external constraint function: A & (K | 0xffff0000).  Note: K is 
  383.    * silently truncated to 16 bits.<p>
  384.    *
  385.    * Note: the "self" object and orientation for this constraint need to
  386.    * be filled in before the constraint is used.<p>
  387.    * 
  388.    * @param ext_objpart_encoding A object/part designator for parameter
  389.    * @param int                  K 16 bit signed value for constant 
  390.    * @return std_ext_constraint constraint object for the result
  391.    */
  392.   public static std_ext_constraint mask(ext_objpart_encoding A, int K) 
  393. {
  394.       K = K & 0xffff;
  395.       int enc = op1_impl.encode(OP_mask, _dummy, (short)0);
  396.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  397.     }
  398.  
  399.    //had:
  400.    //* @exception bad_constraint if some part of the constraint is out of range or
  401.    //*                           malformed.
  402.  
  403.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  404.  
  405.   /** 
  406.    * Create the constraint function: (A - self.wh)/2 + K which is typically
  407.    * used for centering.  Width or height is chosen based on context to have
  408.    * the same orientation as the part being constrained. <p>
  409.    * 
  410.    * @param std_objpart_encoding A object/part designator for parameter
  411.    * @param int              K 16 bit signed value for constant 
  412.    * @return std_constraint constraint object for the result
  413.    */
  414.   public static std_constraint centered(std_objpart_encoding A, int K) 
  415. {
  416.       check_16_bit(K);
  417.       return op1_impl.create(OP_centered, A, (short)K);
  418.     }
  419.  
  420.    //had:
  421.    //* @exception bad_value if some part of the constraint is out of range or
  422.    //*                           malformed.
  423.          
  424.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  425.  
  426.   /** 
  427.    * Create the external constraint function: (A - self.wh)/2 + K which is 
  428.    * typically used for centering.  Width or height is chosen based on the
  429.    * orientation of the constraint. <p>
  430.    *
  431.    * Note: the "self" object and orientation for this constraint need to
  432.    * be filled in before the constraint is used.<p>
  433.    * 
  434.    * @param ext_objpart_encoding A object/part designator for parameter
  435.    * @param int                  K value for constant 
  436.    * @return std_ext_constraint constraint object for the result
  437.    */
  438.   public static std_ext_constraint centered(ext_objpart_encoding A, int K) 
  439. {
  440.       int enc = op1_impl.encode(OP_centered, _dummy, (short)0);
  441.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  442.     }
  443.  
  444.    //had:
  445.    //* @exception bad_value if some part of the constraint is out of range or
  446.    //*                           malformed.
  447.    //* @exception general
  448.          
  449.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  450.  
  451.   /** 
  452.    * Create the constraint function: A + K <p>
  453.    * 
  454.    * @param std_objpart_encoding A object/part designator for parameter
  455.    * @param int              K 16 bit signed value for constant 
  456.    * @return std_constraint constraint object for the result
  457.    */
  458.   public static std_constraint offset(std_objpart_encoding A, int K) 
  459. {
  460.       check_16_bit(K);
  461.       return op1_impl.create(OP_offset, A, (short)K);
  462.     }
  463.  
  464.    //had:
  465.    //* @exception bad_constraint if some part of the constraint is out of range or
  466.    //*                           malformed.
  467.          
  468.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  469.  
  470.   /** 
  471.    * Create the external constraint function: A + K <p>
  472.    *
  473.    * Note: the "self" object and orientation for this constraint need to
  474.    * be filled in before the constraint is used.<p>
  475.    * 
  476.    * @param ext_objpart_encoding A object/part designator for parameter
  477.    * @param int                  K value for constant 
  478.    * @return std_ext_constraint constraint object for the result
  479.    */
  480.   public static std_ext_constraint offset(ext_objpart_encoding A, int K) 
  481. {
  482.       int enc = op1_impl.encode(OP_offset, _dummy, (short)0);
  483.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  484.     }
  485.  
  486.    //had:
  487.    //* @exception bad_value if some part of the constraint is out of range or
  488.    //*                      malformed.
  489.    //* @exception general
  490.          
  491.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  492.  
  493.   /** 
  494.    * Create an equality constraint.  This is really just an offset() 
  495.    * operation with an offset constant of 0.
  496.    * 
  497.    * @param std_objpart_encoding A object/part designator for parameter
  498.    * @param int              K 16 bit signed value for constant 
  499.    * @return std_constraint constraint object for the result
  500.    */
  501.   public static std_constraint eq(std_objpart_encoding A) 
  502. {
  503.       return op1_impl.create(OP_offset, A, (short)0);
  504.     }
  505.  
  506.    //had:
  507.    //* @exception bad_constraint if some part of the constraint is out of range or
  508.    //*                           malformed.
  509.          
  510.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  511.  
  512.   /** 
  513.    * Create an external equality constraint.  This is really just an offset() 
  514.    * operation with an offset constant of 0.
  515.    *
  516.    * Note: the "self" object and orientation for this constraint need to
  517.    * be filled in before the constraint is used.<p>
  518.    * 
  519.    * @param ext_objpart_encoding A object/part designator for parameter
  520.    * @param int                  K value for constant 
  521.    * @return std_ext_constraint constraint object for the result
  522.    */
  523.   public static std_ext_constraint eq(ext_objpart_encoding A) 
  524. {
  525.       int enc = op1_impl.encode(OP_offset, _dummy, (short)0);
  526.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, 0); 
  527.     }
  528.  
  529.    //had
  530.    //* @exception bad_value if some part of the constraint is out of range or
  531.    //*                      malformed.
  532.    //* @exception general
  533.          
  534.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  535.  
  536.   /** 
  537.    * Create the constraint function: A - self.wh - K which is typically
  538.    * used do right or bottom justification.  Width or height is chosen based 
  539.    * on context to have the same orientation as the part being constrained. <p>
  540.    * 
  541.    * @param std_objpart_encoding A object/part designator for parameter
  542.    * @param int              K 16 bit signed value for constant 
  543.    * @return std_constraint constraint object for the result
  544.    */
  545.   public static std_constraint far_edge_just(std_objpart_encoding A, int K) 
  546. {
  547.       check_16_bit(K);
  548.       return op1_impl.create(OP_far_edge_just, A, (short)K);
  549.     }
  550.  
  551.    //had:
  552.    //* @exception bad_constraint if some part of the constraint is out of range or
  553.    //*                           malformed.
  554.          
  555.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  556.  
  557.   /** 
  558.    * Create the external constraint function: A - self.wh - K which is typically
  559.    * used do right or bottom justification.  Width or height is chosen based 
  560.    * on the orientation of the constraint. <p>
  561.    *
  562.    * Note: the "self" object and orientation for this constraint need to
  563.    * be filled in before the constraint is used.<p>
  564.    * 
  565.    * @param ext_objpart_encoding A object/part designator for parameter
  566.    * @param int                  K value for constant 
  567.    * @return std_ext_constraint constraint object for the result
  568.    */
  569.   public static std_ext_constraint far_edge_just(ext_objpart_encoding A, int K) 
  570. {
  571.       int enc = op1_impl.encode(OP_far_edge_just, _dummy, (short)0);
  572.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, K); 
  573.     }
  574.  
  575.    //had:
  576.    //* @exception bad_value if some part of the constraint is out of range or
  577.    //*                      malformed.
  578.    //* @exception general
  579.          
  580.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  581.  
  582.   /** 
  583.    * Create the constraint function: A + B + K <p>
  584.    * 
  585.    * @param std_objpart_encoding A object/part designator for parameter 1
  586.    * @param std_objpart_encoding B object/part designator for parameter 2
  587.    * @param int              K 15 bit signed value for constant 
  588.    * @return std_constraint constraint object for the result
  589.    */
  590.   public static std_constraint add(
  591.     std_objpart_encoding A, 
  592.     std_objpart_encoding B, 
  593.     int K) 
  594. {
  595.       check_15_bit(K);
  596.       return op2_impl.create(OP_add, A, B, (short)K);
  597.     }
  598.  
  599.    //had:
  600.    //* @exception bad_constraint if some part of the constraint is out of range or
  601.    //*                           malformed.
  602.  
  603.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  604.  
  605.   /** 
  606.    * Create the external constraint function: A + B + K <p>
  607.    *
  608.    * Note: the "self" object and orientation for this constraint need to
  609.    * be filled in before the constraint is used.<p>
  610.    * 
  611.    * @param ext_objpart_encoding A object/part designator for parameter 1
  612.    * @param ext_objpart_encoding B object/part designator for parameter 2
  613.    * @param int                  K value for constant 
  614.    * @return std_ext_constraint constraint object for the result
  615.    */
  616.   public static std_ext_constraint add(
  617.     ext_objpart_encoding A, 
  618.     ext_objpart_encoding B, 
  619.     int K) 
  620. {
  621.       int enc = op2_impl.encode(OP_add, _dummy, _dummy, (short)0);
  622.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  623.     }
  624.  
  625.    //had:
  626.    //* @exception bad_value if some part of the constraint is out of range or
  627.    //*                      malformed.
  628.    //* @exception general
  629.  
  630.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  631.  
  632.   /** 
  633.    * Create the constraint function: A - B + K <p>
  634.    * 
  635.    * @param std_objpart_encoding A object/part designator for parameter 1
  636.    * @param std_objpart_encoding B object/part designator for parameter 2
  637.    * @param int              K 15 bit signed value for constant 
  638.    * @return std_constraint constraint object for the result
  639.    */
  640.   public static std_constraint subtract(
  641.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  642. {
  643.       check_15_bit(K);
  644.       return op2_impl.create(OP_subtract, A, B, (short)K);
  645.     }
  646.  
  647.    //had:
  648.    //* @exception bad_constraint if some part of the constraint is out of range or
  649.    //*                           malformed.
  650.  
  651.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  652.  
  653.   /** 
  654.    * Create the external constraint function: A - B + K <p>
  655.    *
  656.    * Note: the "self" object and orientation for this constraint need to
  657.    * be filled in before the constraint is used.<p>
  658.    * 
  659.    * @param ext_objpart_encoding A object/part designator for parameter 1
  660.    * @param ext_objpart_encoding B object/part designator for parameter 2
  661.    * @param int                  K signed value for constant 
  662.    * @return std_ext_constraint constraint object for the result
  663.    */
  664.   public static std_ext_constraint subtract(
  665.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  666. {
  667.       int enc = op2_impl.encode(OP_subtract, _dummy, _dummy, (short)0);
  668.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  669.     }
  670.  
  671.    //had:
  672.    //* @exception bad_value if some part of the constraint is out of range or
  673.    //*                      malformed.
  674.    //* @exception general
  675.  
  676.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  677.  
  678.   /** 
  679.    * Create the constraint function: A * B + K <p>
  680.    * 
  681.    * @param std_objpart_encoding A object/part designator for parameter 1
  682.    * @param std_objpart_encoding B object/part designator for parameter 2
  683.    * @param int              K 15 bit signed value for constant 
  684.    * @return std_constraint constraint object for the result
  685.    */
  686.   public static std_constraint mult(
  687.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  688. {
  689.       check_15_bit(K);
  690.       return op2_impl.create(OP_mult, A, B, (short)K);
  691.     }
  692.  
  693.    //had:
  694.    //* @exception bad_constraint if some part of the constraint is out of range or
  695.    //*                           malformed.
  696.  
  697.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  698.  
  699.   /** 
  700.    * Create the external constraint function: A * B + K <p>
  701.    *
  702.    * Note: the "self" object and orientation for this constraint need to
  703.    * be filled in before the constraint is used.<p>
  704.    * 
  705.    * @param ext_objpart_encoding A object/part designator for parameter 1
  706.    * @param ext_objpart_encoding B object/part designator for parameter 2
  707.    * @param int                  K value for constant 
  708.    * @return std_ext_constraint constraint object for the result
  709.    */
  710.   public static std_ext_constraint mult(
  711.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  712. {
  713.       int enc = op2_impl.encode(OP_mult,  _dummy, _dummy, (short)0);
  714.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  715.     }
  716.  
  717.    //had:
  718.    //* @exception bad_value if some part of the constraint is out of range or
  719.    //*                      malformed.
  720.    //* @exception general
  721.  
  722.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  723.  
  724.   /** 
  725.    * Create the constraint function: (A / B) + K  (returns K on div by zero) <p>
  726.    * 
  727.    * @param std_objpart_encoding A object/part designator for parameter 1
  728.    * @param std_objpart_encoding B object/part designator for parameter 2
  729.    * @param int              K 15 bit signed value for constant 
  730.    * @return std_constraint constraint object for the result
  731.    */
  732.   public static std_constraint div(
  733.     std_objpart_encoding A, 
  734.     std_objpart_encoding B, 
  735.     int K) 
  736. {
  737.       check_15_bit(K);
  738.       return op2_impl.create(OP_div, A, B, (short)K);
  739.     }
  740.  
  741.    //had:
  742.    //* @exception bad_constraint if some part of the constraint is out of range or
  743.    //*                           malformed.
  744.  
  745.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  746.  
  747.   /** 
  748.    * Create the external constraint function: (A / B) + K  (returns K on div 
  749.    * by zero) <p>
  750.    *
  751.    * Note: the "self" object and orientation for this constraint need to
  752.    * be filled in before the constraint is used.<p>
  753.    * 
  754.    * @param ext_objpart_encoding A object/part designator for parameter 1
  755.    * @param ext_objpart_encoding B object/part designator for parameter 2
  756.    * @param int                  K value for constant 
  757.    * @return std_ext_constraint constraint object for the result
  758.    */
  759.   public static std_ext_constraint div(
  760.     ext_objpart_encoding A, 
  761.     ext_objpart_encoding B, 
  762.     int K) 
  763. {
  764.       int enc = op2_impl.encode(OP_div, _dummy, _dummy, (short)0);
  765.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  766.     }
  767.  
  768.    //had:
  769.    //* @exception bad_value if some part of the constraint is out of range or
  770.    //*                      malformed.
  771.    //* @exception general
  772.  
  773.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  774.  
  775.   /** 
  776.    * Create the constraint function: (A % B) + K  (returns K on mod by zero) <p>
  777.    * 
  778.    * @param std_objpart_encoding A object/part designator for parameter 1
  779.    * @param std_objpart_encoding B object/part designator for parameter 2
  780.    * @param int              K 15 bit signed value for constant 
  781.    * @return std_constraint constraint object for the result
  782.    */
  783.   public static std_constraint mod(
  784.     std_objpart_encoding A, 
  785.     std_objpart_encoding B, 
  786.     int K) 
  787. {
  788.       check_15_bit(K);
  789.       return op2_impl.create(OP_mod, A, B, (short)K);
  790.     }
  791.  
  792.    //had:
  793.    //* @exception bad_constraint if some part of the constraint is out of range or
  794.    //*                           malformed.
  795.  
  796.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  797.  
  798.   /** 
  799.    * Create the external constraint function: (A % B) + K  (returns K on mod 
  800.    * by zero) <p>
  801.    *
  802.    * Note: the "self" object and orientation for this constraint need to
  803.    * be filled in before the constraint is used.<p>
  804.    * 
  805.    * @param ext_objpart_encoding A object/part designator for parameter 1
  806.    * @param ext_objpart_encoding B object/part designator for parameter 2
  807.    * @param int                  K value for constant 
  808.    * @return std_ext_constraint constraint object for the result
  809.    */
  810.   public static std_ext_constraint mod(
  811.     ext_objpart_encoding A, 
  812.     ext_objpart_encoding B, 
  813.     int K) 
  814. {
  815.       int enc = op2_impl.encode(OP_mod, _dummy, _dummy, (short)0);
  816.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  817.     }
  818.  
  819.    //had:
  820.    //* @exception bad_value if some part of the constraint is out of range or
  821.    //*                      malformed.
  822.    //* @exception general
  823.  
  824.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  825.  
  826.   /** 
  827.    * Create the constraint function: A & B & K. Note: K is silently truncated
  828.    * to 15 bits.<p> 
  829.    * 
  830.    * @param std_objpart_encoding A object/part designator for parameter 1
  831.    * @param std_objpart_encoding B object/part designator for parameter 2
  832.    * @param int              K 15 bit signed value for constant 
  833.    * @return std_constraint constraint object for the result
  834.    */
  835.   public static std_constraint and(
  836.     std_objpart_encoding A, 
  837.     std_objpart_encoding B, 
  838.     int K) 
  839. {
  840.       K = K & 0x7fff;
  841.       return op2_impl.create(OP_and, A, B, (short)K);
  842.     }
  843.  
  844.    //had:
  845.    //* @exception bad_constraint if some part of the constraint is out of range or
  846.    //*                           malformed.
  847.  
  848.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  849.  
  850.   /** 
  851.    * Create the external constraint function: A & B & K. Note: K is silently 
  852.    * truncated to 15 bits.<p> 
  853.    *
  854.    * Note: the "self" object and orientation for this constraint need to
  855.    * be filled in before the constraint is used.<p>
  856.    * 
  857.    * @param ext_objpart_encoding A object/part designator for parameter 1
  858.    * @param ext_objpart_encoding B object/part designator for parameter 2
  859.    * @param int                  K value for constant 
  860.    * @return std_ext_constraint constraint object for the result
  861.    */
  862.   public static std_ext_constraint and(
  863.     ext_objpart_encoding A, 
  864.     ext_objpart_encoding B, 
  865.     int K) 
  866. {
  867.       K = K & 0x7fff;
  868.       int enc = op2_impl.encode(OP_and, _dummy, _dummy, (short)0);
  869.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  870.     }
  871.  
  872.    //had:
  873.    //* @exception bad_value if some part of the constraint is out of range or
  874.    //*                      malformed.
  875.    //* @exception general
  876.  
  877.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  878.  
  879.   /** 
  880.    * Create the constraint function: (A | B) & K. Note: K is silently truncated
  881.    * to 15 bits.<p>
  882.    * 
  883.    * @param std_objpart_encoding A object/part designator for parameter 1
  884.    * @param std_objpart_encoding B object/part designator for parameter 2
  885.    * @param int              K 15 bit signed value for constant 
  886.    * @return std_constraint constraint object for the result
  887.    */
  888.   public static std_constraint or(
  889.     std_objpart_encoding A, 
  890.     std_objpart_encoding B, 
  891.     int K) 
  892. {
  893.       K = K & 0x7fff;
  894.       return op2_impl.create(OP_or, A, B, (short)K);
  895.     }
  896.  
  897.    //had:
  898.    //* @exception bad_constraint if some part of the constraint is out of range or
  899.    //*                           malformed.
  900.  
  901.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  902.  
  903.   /** 
  904.    * Create the external constraint function: (A | B) & K. Note: K is silently 
  905.    * truncated to 15 bits.<p>
  906.    *
  907.    * Note: the "self" object and orientation for this constraint need to
  908.    * be filled in before the constraint is used.<p>
  909.    * 
  910.    * @param ext_objpart_encoding A object/part designator for parameter 1
  911.    * @param ext_objpart_encoding B object/part designator for parameter 2
  912.    * @param int                  K value for constant 
  913.    * @return std_ext_constraint constraint object for the result
  914.    */
  915.   public static std_ext_constraint or(
  916.     ext_objpart_encoding A, 
  917.     ext_objpart_encoding B, 
  918.     int K) 
  919. {
  920.       K = K & 0x7fff;
  921.       int enc = op2_impl.encode(OP_or, _dummy, _dummy, (short)0);
  922.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  923.     }
  924.  
  925.    //had:
  926.    //* @exception bad_value if some part of the constraint is out of range or
  927.    //*                      malformed.
  928.    //* @exception general
  929.  
  930.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  931.  
  932.   /** 
  933.    * Create the constraint function: (A ^ B) & K. Note: K is silently truncated
  934.    * to 15 bits.<p>
  935.    * 
  936.    * @param std_objpart_encoding A object/part designator for parameter 1
  937.    * @param std_objpart_encoding B object/part designator for parameter 2
  938.    * @param int              K 15 bit signed value for constant 
  939.    * @return std_constraint constraint object for the result
  940.    */
  941.   public static std_constraint xor(
  942.     std_objpart_encoding A, 
  943.     std_objpart_encoding B, 
  944.     int K) 
  945. {
  946.       K = K & 0x7fff;
  947.       return op2_impl.create(OP_xor, A, B, (short)K);
  948.     }
  949.  
  950.    //had:
  951.    //* @exception bad_constraint if some part of the constraint is out of range or
  952.    //*                           malformed.
  953.  
  954.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  955.  
  956.   /** 
  957.    * Create the external constraint function: (A ^ B) & K. Note: K is silently 
  958.    * truncated to 15 bits.<p>
  959.    *
  960.    * Note: the "self" object and orientation for this constraint need to
  961.    * be filled in before the constraint is used.<p>
  962.    * 
  963.    * @param ext_objpart_encoding A object/part designator for parameter 1
  964.    * @param ext_objpart_encoding B object/part designator for parameter 2
  965.    * @param int                  K value for constant 
  966.    * @return std_ext_constraint constraint object for the result
  967.    */
  968.   public static std_ext_constraint xor(
  969.     ext_objpart_encoding A, 
  970.     ext_objpart_encoding B, 
  971.     int K) 
  972. {
  973.       K = K & 0x7fff;
  974.       int enc = op2_impl.encode(OP_xor,  _dummy, _dummy, (short)0);
  975.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  976.     }
  977.  
  978.    //had:
  979.    //* @exception bad_value if some part of the constraint is out of range or
  980.    //*                      malformed.
  981.    //* @exception general
  982.  
  983.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  984.  
  985.   /** 
  986.    * Create the constraint function: min(A,B) + K<p>
  987.    * 
  988.    * @param std_objpart_encoding A object/part designator for parameter 1
  989.    * @param std_objpart_encoding B object/part designator for parameter 2
  990.    * @param int              K 15 bit signed value for constant 
  991.    * @return std_constraint constraint object for the result
  992.    */
  993.   public static std_constraint min(
  994.     std_objpart_encoding A, 
  995.     std_objpart_encoding B, 
  996.     int K) 
  997. {
  998.       check_15_bit(K);
  999.       return op2_impl.create(OP_min, A, B, (short)K);
  1000.     }
  1001.  
  1002.    //had:
  1003.    //* @exception bad_constraint if some part of the constraint is out of range or
  1004.    //*                           malformed.
  1005.  
  1006.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1007.  
  1008.   /** 
  1009.    * Create the external constraint function: min(A,B) + K<p>
  1010.    *
  1011.    * Note: the "self" object and orientation for this constraint need to
  1012.    * be filled in before the constraint is used.<p>
  1013.    * 
  1014.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1015.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1016.    * @param int                  K value for constant 
  1017.    * @return std_ext_constraint constraint object for the result
  1018.    */
  1019.   public static std_ext_constraint min(
  1020.     ext_objpart_encoding A, 
  1021.     ext_objpart_encoding B, 
  1022.     int K) 
  1023. {
  1024.       int enc = op2_impl.encode(OP_min, _dummy, _dummy, (short)0);
  1025.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1026.     }
  1027.  
  1028.    //had:
  1029.    //* @exception bad_value if some part of the constraint is out of range or
  1030.    //*                      malformed.
  1031.    //* @exception general
  1032.  
  1033.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1034.  
  1035.   /** 
  1036.    * Create the constraint function: max(A,B) + K<p>
  1037.    * 
  1038.    * @param std_objpart_encoding A object/part designator for parameter 1
  1039.    * @param std_objpart_encoding B object/part designator for parameter 2
  1040.    * @param int              K 15 bit signed value for constant 
  1041.    * @return std_constraint constraint object for the result
  1042.    */
  1043.   public static std_constraint max(
  1044.     std_objpart_encoding A, 
  1045.     std_objpart_encoding B, 
  1046.     int K) 
  1047. {
  1048.       check_15_bit(K);
  1049.       return op2_impl.create(OP_max, A, B, (short)K);
  1050.     }
  1051.  
  1052.    //had:
  1053.    //* @exception bad_constraint if some part of the constraint is out of range or
  1054.    //*                           malformed.
  1055.  
  1056.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1057.  
  1058.   /** 
  1059.    * Create the external constraint function: max(A,B) + K<p>
  1060.    *
  1061.    * Note: the "self" object and orientation for this constraint need to
  1062.    * be filled in before the constraint is used.<p>
  1063.    * 
  1064.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1065.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1066.    * @param int                  K value for constant 
  1067.    * @return std_ext_constraint constraint object for the result
  1068.    */
  1069.   public static std_ext_constraint max(
  1070.     ext_objpart_encoding A, 
  1071.     ext_objpart_encoding B, 
  1072.     int K) 
  1073. {
  1074.       int enc = op2_impl.encode(OP_max, _dummy, _dummy, (short)0);
  1075.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1076.     }
  1077.  
  1078.    //had:
  1079.    //* @exception bad_value if some part of the constraint is out of range or
  1080.    //*                      malformed.
  1081.    //* @exception general
  1082.  
  1083.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1084.  
  1085.   /** 
  1086.    * Create the constraint function: (A + B)/2 + K<p>
  1087.    * 
  1088.    * @param std_objpart_encoding A object/part designator for parameter 1
  1089.    * @param std_objpart_encoding B object/part designator for parameter 2
  1090.    * @param int              K 15 bit signed value for constant 
  1091.    * @return std_constraint constraint object for the result
  1092.    */
  1093.   public static std_constraint ave(
  1094.     std_objpart_encoding A, 
  1095.     std_objpart_encoding B, 
  1096.     int K) 
  1097. {
  1098.       check_15_bit(K);
  1099.       return op2_impl.create(OP_ave, A, B, (short)K);
  1100.     }
  1101.  
  1102.    //had:
  1103.    //* @exception bad_constraint if some part of the constraint is out of range or
  1104.    //*                           malformed.
  1105.  
  1106.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1107.  
  1108.   /** 
  1109.    * Create the external constraint function: (A + B)/2 + K<p>
  1110.    *
  1111.    * Note: the "self" object and orientation for this constraint need to
  1112.    * be filled in before the constraint is used.<p>
  1113.    * 
  1114.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1115.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1116.    * @param int                  K value for constant 
  1117.    * @return std_ext_constraint constraint object for the result
  1118.    */
  1119.   public static std_ext_constraint ave(
  1120.     ext_objpart_encoding A, 
  1121.     ext_objpart_encoding B, 
  1122.     int K) 
  1123. {
  1124.       int enc = op2_impl.encode(OP_ave, _dummy, _dummy, (short)0);
  1125.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1126.     }
  1127.  
  1128.    //had:
  1129.    //* @exception bad_value if some part of the constraint is out of range or
  1130.    //*                      malformed.
  1131.    //* @exception general
  1132.  
  1133.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1134.  
  1135.   /** 
  1136.    * Create the constraint function: rotate_x(theta, D) + K where rotate_x 
  1137.    * computes the x position found by rotating the point dist,0 by theta/1000 
  1138.    * degrees counter-clockwise (i.e. a scaled sine function).<p>
  1139.    * 
  1140.    * @param std_objpart_encoding theta obj/part designator for angle parameter
  1141.    * @param std_objpart_encoding dist obj/part designator for distance parameter
  1142.    * @param int              K 15 bit signed value for constant 
  1143.    * @return std_constraint constraint object for the result
  1144.    */
  1145.   public static std_constraint rotx(
  1146.     std_objpart_encoding theta, std_objpart_encoding dist, int K) 
  1147. {
  1148.       check_15_bit(K);
  1149.       return op2_impl.create(OP_rotx, theta, dist, (short)K);
  1150.     }
  1151.  
  1152.    //had:
  1153.    //* @exception bad_constraint if some part of the constraint is out of range or
  1154.    //*                           malformed.
  1155.  
  1156.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1157.  
  1158.   /** 
  1159.    * Create the external constraint function: rotate_x(theta, D) + K where 
  1160.    * rotate_x computes the x position found by rotating the point dist,0 by 
  1161.    * theta/1000 degrees counter-clockwise (i.e. a scaled sine function).<p>
  1162.    *
  1163.    * Note: the "self" object and orientation for this constraint need to
  1164.    * be filled in before the constraint is used.<p>
  1165.    * 
  1166.    * @param ext_objpart_encoding theta obj/part designator for angle parameter
  1167.    * @param ext_objpart_encoding dist obj/part designator for distance parameter
  1168.    * @param int                  K value for constant 
  1169.    * @return std_ext_constraint constraint object for the result
  1170.    */
  1171.   public static std_ext_constraint rotx(
  1172.     ext_objpart_encoding theta, ext_objpart_encoding dist, int K) 
  1173. {
  1174.       int enc = op2_impl.encode(OP_rotx, _dummy, _dummy, (short)0);
  1175.       return new std_ext_constraint(enc, null, NOT_ORIENTED, theta, dist,  K); 
  1176.     }
  1177.  
  1178.    //had:
  1179.    //* @exception bad_value if some part of the constraint is out of range or
  1180.    //*                      malformed.
  1181.    //* @exception general
  1182.  
  1183.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1184.  
  1185.   /** 
  1186.    * Create the constraint function: rotate_y(theta, D) + K where rotate_y 
  1187.    * computes the y position found by rotating the point dist,0 by theta/1000 
  1188.    * degrees counter-clockwise (i.e., a scaled cosine function).<p>
  1189.    * 
  1190.    * @param std_objpart_encoding theta obj/part designator for angle parameter
  1191.    * @param std_objpart_encoding dist obj/part designator for distance parameter
  1192.    * @param int              K 15 bit signed value for constant 
  1193.    * @return std_constraint constraint object for the result
  1194.    */
  1195.   public static std_constraint roty(
  1196.     std_objpart_encoding theta, std_objpart_encoding dist, int K) 
  1197. {
  1198.       check_15_bit(K);
  1199.       return op2_impl.create(OP_roty, theta, dist, (short)K);
  1200.     }
  1201.  
  1202.    //had:
  1203.    //* @exception bad_constraint if some part of the constraint is out of range or
  1204.    //*                           malformed.
  1205.  
  1206.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1207.  
  1208.   /** 
  1209.    * Create the external constraint function: rotate_y(theta, D) + K where 
  1210.    * rotate_y computes the y position found by rotating the point dist,0 by 
  1211.    * theta/1000 degrees counter-clockwise (i.e., a scaled cosine function).<p>
  1212.    *
  1213.    * Note: the "self" object and orientation for this constraint need to
  1214.    * be filled in before the constraint is used.<p>
  1215.    * 
  1216.    * @param ext_objpart_encoding theta obj/part designator for angle parameter
  1217.    * @param ext_objpart_encoding dist obj/part designator for distance parameter
  1218.    * @param int                  K value for constant 
  1219.    * @return std_ext_constraint constraint object for the result
  1220.    */
  1221.   public static std_ext_constraint roty(
  1222.     ext_objpart_encoding theta, ext_objpart_encoding dist, int K) 
  1223. {
  1224.       int enc = op2_impl.encode(OP_roty, _dummy, _dummy, (short)0);
  1225.       return new std_ext_constraint(enc, null, NOT_ORIENTED, theta, dist, K); 
  1226.     }
  1227.  
  1228.    //had:
  1229.    //* @exception bad_value if some part of the constraint is out of range or
  1230.    //*                      malformed.
  1231.    //* @exception general
  1232.  
  1233.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1234.  
  1235.   /** 
  1236.    * Create the constraint function: (if self.enabled then A else B) + K.
  1237.    * 
  1238.    * @param std_objpart_encoding A object/part designator for parameter 1
  1239.    * @param std_objpart_encoding B object/part designator for parameter 2
  1240.    * @param int              K 15 bit signed value for constant 
  1241.    * @return std_constraint constraint object for the result
  1242.    */
  1243.   public static std_constraint if_enabled(
  1244.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  1245. {
  1246.       check_15_bit(K);
  1247.       return op2_impl.create(OP_if_enabled, A, B, (short)K);
  1248.     }
  1249.  
  1250.    //had:
  1251.    //* @exception bad_constraint if some part of the constraint is out of range or
  1252.    //*                           malformed.
  1253.  
  1254.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1255.  
  1256.   /** 
  1257.    * Create the external constraint function: 
  1258.    * (if self.enabled then A else B) + K.<p>
  1259.    *
  1260.    * Note: the "self" object and orientation for this constraint need to
  1261.    * be filled in before the constraint is used.<p>
  1262.    * 
  1263.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1264.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1265.    * @param int                  K svalue for constant 
  1266.    * @return std_ext_constraint constraint object for the result
  1267.    */
  1268.   public static std_ext_constraint if_enabled(
  1269.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  1270. {
  1271.       int enc = op2_impl.encode(OP_if_enabled, _dummy, _dummy, (short)0);
  1272.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1273.     }
  1274.  
  1275.    //had:
  1276.    //* @exception bad_value if some part of the constraint is out of range or
  1277.    //*                      malformed.
  1278.    //* @exception general
  1279.  
  1280.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1281.  
  1282.   /** 
  1283.    * Create the constraint function: (if self.visible then A else B) + K.
  1284.    * 
  1285.    * @param std_objpart_encoding A object/part designator for parameter 1
  1286.    * @param std_objpart_encoding B object/part designator for parameter 2
  1287.    * @param int              K 15 bit signed value for constant 
  1288.    * @return std_constraint constraint object for the result
  1289.    */
  1290.   public static std_constraint if_visible(
  1291.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  1292. {
  1293.       check_15_bit(K);
  1294.       return op2_impl.create(OP_if_visible, A, B, (short)K);
  1295.     }
  1296.  
  1297.    //had:
  1298.    //* @exception bad_constraint if some part of the constraint is out of range or
  1299.    //*                           malformed.
  1300.  
  1301.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1302.  
  1303.   /** 
  1304.    * Create the external constraint function: 
  1305.    * (if self.visible then A else B) + K.<p>
  1306.    *
  1307.    * Note: the "self" object and orientation for this constraint need to
  1308.    * be filled in before the constraint is used.<p>
  1309.    * 
  1310.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1311.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1312.    * @param int                  K value for constant 
  1313.    * @return std_ext_constraint constraint object for the result
  1314.    */
  1315.   public static std_ext_constraint if_visible(
  1316.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  1317. {
  1318.       int enc = op2_impl.encode(OP_if_visible, _dummy, _dummy, (short)0);
  1319.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1320.     }
  1321.  
  1322.    //had:
  1323.    //* @exception bad_value if some part of the constraint is out of range or
  1324.    //*                      malformed.
  1325.    //* @exception general
  1326.  
  1327.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1328.  
  1329.   /** 
  1330.    * Create the constraint function: self.fun2(A,B,K) which is a special 
  1331.    * function in all interactors that can be overridden to to subclass specific 
  1332.    * things.
  1333.    * <p>
  1334.    * 
  1335.    * @param std_objpart_encoding A object/part designator for parameter 1
  1336.    * @param std_objpart_encoding B object/part designator for parameter 2
  1337.    * @param int              K 15 bit signed value for constant 
  1338.    * @return std_constraint constraint object for the result
  1339.    */
  1340.   public static std_constraint self_fun2(
  1341.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  1342. {
  1343.       check_15_bit(K);
  1344.       return op2_impl.create(OP_self_fun2, A, B, (short)K);
  1345.     }
  1346.  
  1347.    //had:
  1348.    //* @exception bad_constraint if some part of the constraint is out of range or
  1349.    //*                           malformed.
  1350.  
  1351.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1352.  
  1353.   /** 
  1354.    * Create the external constraint function: self.fun2(A,B,K) which is a 
  1355.    * special function in all interactors that can be overridden to to subclass 
  1356.    * specific things. <p>
  1357.    *
  1358.    * Note: the "self" object and orientation for this constraint need to
  1359.    * be filled in before the constraint is used.<p>
  1360.    * 
  1361.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1362.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1363.    * @param int                  K value for constant 
  1364.    * @return std_ext_constraint constraint object for the result
  1365.    */
  1366.   public static std_ext_constraint self_fun2(
  1367.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  1368. {
  1369.       int enc = op2_impl.encode(OP_self_fun2, _dummy, _dummy, (short)0);
  1370.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1371.     }
  1372.  
  1373.    //had:
  1374.    //* @exception bad_value if some part of the constraint is out of range or
  1375.    //*                      malformed.
  1376.    //* @exception general
  1377.  
  1378.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1379.  
  1380.   /** 
  1381.    * Create the constraint function: parent.fun2(A,B,K) which is a special 
  1382.    * function in all interactors that can be overridden to to subclass specific 
  1383.    * things.
  1384.    * <p>
  1385.    * 
  1386.    * @param std_objpart_encoding A object/part designator for parameter 1
  1387.    * @param std_objpart_encoding B object/part designator for parameter 2
  1388.    * @param int              K 15 bit signed value for constant 
  1389.    * @return std_constraint constraint object for the result
  1390.    */
  1391.   public static std_constraint parent_fun2(
  1392.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  1393. {
  1394.       check_15_bit(K);
  1395.       return op2_impl.create(OP_parent_fun2, A, B, (short)K);
  1396.     }
  1397.  
  1398.    //had:
  1399.    //* @exception bad_constraint if some part of the constraint is out of range or
  1400.    //*                           malformed.
  1401.  
  1402.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1403.  
  1404.   /** 
  1405.    * Create the external constraint function: parent.fun2(A,B,K) which is a 
  1406.    * special function in all interactors that can be overridden to to subclass 
  1407.    * specific things.<p>
  1408.    *
  1409.    * Note: the "self" object and orientation for this constraint need to
  1410.    * be filled in before the constraint is used.<p>
  1411.    * 
  1412.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1413.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1414.    * @param int                  K value for constant 
  1415.    * @return std_ext_constraint constraint object for the result
  1416.    */
  1417.   public static std_ext_constraint parent_fun2(
  1418.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  1419. {
  1420.       int enc = op2_impl.encode(OP_parent_fun2, _dummy, _dummy, (short)0);
  1421.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1422.     }
  1423.  
  1424.    //had:
  1425.    //* @exception bad_value if some part of the constraint is out of range or
  1426.    //*                      malformed.
  1427.    //* @exception general
  1428.  
  1429.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1430.  
  1431.   /** 
  1432.    * Create the constraint function for fill: B - A - K <p>
  1433.    * 
  1434.    * @param std_objpart_encoding A object/part designator for parameter 1
  1435.    * @param std_objpart_encoding B object/part designator for parameter 2
  1436.    * @param int              K 15 bit signed value for constant 
  1437.    * @return std_constraint constraint object for the result
  1438.    */
  1439.   public static std_constraint fill(
  1440.     std_objpart_encoding A, std_objpart_encoding B, int K) 
  1441. {
  1442.       check_15_bit(K);
  1443.       return op2_impl.create(OP_fill, A, B, (short)K);
  1444.     }
  1445.  
  1446.    //had:
  1447.    //* @exception bad_constraint if some part of the constraint is out of range or
  1448.    //*                           malformed.
  1449.  
  1450.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1451.  
  1452.   /** 
  1453.    * Create the external constraint function for fill: B - A - K <p>
  1454.    *
  1455.    * Note: the "self" object and orientation for this constraint need to
  1456.    * be filled in before the constraint is used.<p>
  1457.    * 
  1458.    * @param ext_objpart_encoding A object/part designator for parameter 1
  1459.    * @param ext_objpart_encoding B object/part designator for parameter 2
  1460.    * @param int                  K value for constant 
  1461.    * @return std_ext_constraint constraint object for the result
  1462.    */
  1463.   public static std_ext_constraint fill(
  1464.     ext_objpart_encoding A, ext_objpart_encoding B, int K) 
  1465. {
  1466.       int enc = op2_impl.encode(OP_fill, _dummy, _dummy, (short)0);
  1467.       return new std_ext_constraint(enc, null, NOT_ORIENTED, A, B, K); 
  1468.     }
  1469.  
  1470.    //had:
  1471.    //* @exception bad_value if some part of the constraint is out of range or
  1472.    //*                      malformed.
  1473.    //* @exception general
  1474.  
  1475.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1476.  
  1477.   /** 
  1478.    * Create an object reference to an arbitrary object.  This can be "filled
  1479.    * out" using the "part" methods of std_objpart_encoding (e.g., X(), etc.).
  1480.    * @param interactor to_obj the object being referenced.
  1481.    */
  1482.   public static ext_objpart_encoding OBJ(interactor to_obj)
  1483.     {
  1484.       return new ext_objpart_encoding(to_obj, 0);
  1485.     }
  1486.  
  1487.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  1488. }
  1489. /*=========================== COPYRIGHT NOTICE ===========================
  1490.  
  1491. This file is part of the subArctic user interface toolkit.
  1492.  
  1493. Copyright (c) 1996 Scott Hudson and Ian Smith
  1494. All rights reserved.
  1495.  
  1496. The subArctic system is freely available for most uses under the terms
  1497. and conditions described in 
  1498.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  1499. and appearing in full in the lib/interactor.java source file.
  1500.  
  1501. The current release and additional information about this software can be 
  1502. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  1503.  
  1504. ========================================================================*/
  1505.